(function(){
	function detectZoom (){
	  var ratio = 0,
	    screen = window.screen,
	    ua = navigator.userAgent.toLowerCase();
	  
	   if (window.devicePixelRatio !== undefined) {
	      ratio = window.devicePixelRatio;
	  }
	  else if (~ua.indexOf('msie')) {
	    if (screen.deviceXDPI && screen.logicalXDPI) {
	      ratio = screen.deviceXDPI / screen.logicalXDPI;
	    }
	  }
	  else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
	    ratio = window.outerWidth / window.innerWidth;
	  }
	    
	   if (ratio){
	    ratio = Math.round(ratio * 100);
	  }
	    
	   return ratio;
	};
	var size = detectZoom();	
	//兼容性写法，该函数也是网上别人写的，不过找不到出处了，蛮好的，所有我也没有必要修改了
	//判断鼠标滚轮滚动方向
	if (window.addEventListener)//FF,火狐浏览器会识别该方法
	    window.addEventListener('DOMMouseScroll', wheel, false);
	window.onmousewheel = document.onmousewheel = wheel;//W3C
	//统一处理滚轮滚动事件
	function wheel(event){
	    var delta = 0;
		// console.log(event.ctrlKey);
	    if (!event) event = window.event;
	    if (event.wheelDelta) {//IE、chrome浏览器使用的是wheelDelta，并且值为“正负120”
	        delta = event.wheelDelta/120; 
	        if (window.opera) delta = -delta;//因为IE、chrome等向下滚动是负值，FF是正值，为了处理一致性，在此取反处理
	    } else if (event.detail) {//FF浏览器使用的是detail,其值为“正负3”
	        delta = -event.detail/3;
	    }
	    if (delta)
	        handle(delta);
	}
	//上下滚动时的具体处理函数
	function handle(delta) {
	if (delta <0){//向下滚动
	        // console.log("1");
			alterSize()
			// 最终功能代码  判断当前缩放值是不是在正常范围内,如果在,HTML标签需要隐藏横向滚动条    ,否则HTML标签加上横向滚动条
			if(alterSize() <= "90" || alterSize() >= "110"){
				// console.log(document.querySelector("html"));
				document.querySelector("html").style.overflowX = "auto";
			}else{
				document.querySelector("html").style.overflowX = "hidden";
			}
	    }else{//向上滚动
	        // console.log("2");
			if(alterSize() <= "90" || alterSize() >= "110"){
				// console.log(document.querySelector("html"));
				document.querySelector("html").style.overflowX = "auto";
			}else{
				document.querySelector("html").style.overflowX = "hidden";
			}
	    }
	}
	// 改变size大小函数
	function alterSize(){
		if (event.ctrlKey) {
		 return detectZoom();
		}
	}
})();